/**
 * 创建网易云音乐播放器
 * @param {number} id 歌单id
 * @param {boolean} autoplay 是否自动播放
 */
export default function createPlayer(id, autoplay) {
  const iframe = document.createElement("iframe");
  iframe.frameBorder = "no";
  iframe.marginWidth = "0";
  iframe.marginHeight = "0";
  iframe.width = 330;
  iframe.height = 450;
  if (autoplay) {
    iframe.allow = "autoplay";
  }
  iframe.src = `https://music.163.com/outchain/player?type=0&id=${id}&auto=1&height=430`;
  iframe.style.border = "0";
  return iframe;
}
